<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\StewardService;

class Steward extends Api
{
    protected $noNeedLogin = ['details','forte_lists'];
    protected $noNeedRight = ['*'];

    /**
     * 管家特长列表
     *
     */
    public function forte_lists(){
        $res = StewardService::getForteList();
        return json($res);
    }

    /**
     * 申请管家
     *
     */
    public function apply()
    {
        $data = $this->request->post();
        $res = StewardService::applySteward($data);
        return json($res);
    }

    /**
     * 申请结果
     *
     */
    public function apply_result()
    {
        $data['user_id'] = $this->auth->id;
        $res = StewardService::getApplyStewardResult($data);
        return json($res);
    }

    /**
     * 管家列表
     *
     */
    public function list(){
        $data = $this->request->post();
        $res = StewardService::getStewardList($data);
        return json($res);
    }

    /**
     * 管家详情
     *
     */
    public function details(){
        $data = $this->request->get();
        $res = StewardService::getStewardDetails($data);
        return json($res);
    }

    /**
     * 管家个人中心
     *
     */
    public function personal(){
        $data = $this->request->post();
        $res = StewardService::stewardCenter($data);
        return json($res);
    }

    /**
     * 管家收入明细
     *
     */
    public function money(){
        $data = $this->request->post();
        $res = StewardService::getMoneyLog($data);
        return json($res);
    }

    /**
     * 累计收入
     *
     */
    public function add_up(){
        $data = $this->request->post();
        $res = StewardService::getAddUp($data);
        return json($res);
    }

    /**
     * 管家提现
     *
     */
    public function withdrawal(){
        $data = $this->request->post();
        $res = StewardService::applyWithdrawal($data);
        return json($res);
    }

    /**
     * 管家提现列表
     *
     */
    public function withdrawal_lists(){
        $data = $this->request->post();
        $res = StewardService::getWithdrawalList($data);
        return json($res);
    }

    /**
     * 管家提现详情
     *
     */
    public function withdrawal_details(){
        $data = $this->request->post();
        $res = StewardService::getWithdrawalDetails($data);
        return json($res);
    }
    /**
     * 新增提现账户
     *
     */
    public function addbank(){
        $data = $this->request->post();
        $res = StewardService::addWithdrawAccount($data);
        return json($res);
    }

    /**
     * 编辑提现账户
     *
     */
    public function editbank(){
        $data = $this->request->post();
        $res = StewardService::editWithdrawAccount($data);
        return json($res);
    }

    /**
     * 提现账户列表
     *
     */
    public function listbank(){
        $data = $this->request->post();
        $res = StewardService::getWithdrawAccountList($data);
        return json($res);
    }


    /**
     * 删除提现账户
     *
     */
    public function delbank(){
        $data = $this->request->post();
        $res = StewardService::delWithdrawAccount($data);
        return json($res);
    }

    /**
     * 邀请排行
     *
     */
    public function share_rank(){
        $data = $this->request->post();
        $res = StewardService::getShareRank($data);
        return json($res);
    }

    /**
     * 我的邀请
     *
     */
    public function share_mine(){
        $data = $this->request->post();
        $res = StewardService::getShareMine($data);
        return json($res);
    }

    /**
     * 分享二维码
     *
     */
    public function share_qr(){
        $data = $this->request->post();
        $res = StewardService::getShareQr($data);
        return json($res);
    }

}